<?php if (!defined('THINK_PATH')) exit();?><input type="hidden" id="user_id" value="<?php echo ($user["id"]); ?>"/>
<div class="form-item">
 	<label class="item-label">认证状态<span class="check-tips">（合格认证）</span></label>
	<?php if($user['is_auth'] == false): ?><input type="input" class="text input-large" readonly value="未认证" />
	<?php else: ?>	
		<input type="input" class="text input-large" readonly value="已认证"/><?php endif; ?>
 </div>
<div class="form-item">
 	<label class="item-label">标记说明<span class="check-tips">（如果对用户合格认证进行标记，必需给出说明）</span></label>
	<textarea id="note" class="div-desc"></textarea>
 </div>
 <div class="form-item">
 	<label class="item-label">标记记录<span class="check-tips"></span></label>
	<div id="note" class="div-desc">
		<?php if(is_array($user['log'])): foreach($user['log'] as $key=>$val): ?><div>
				<strong><?php echo date('Y-m-d H:i:s', $val['create_time']);?>　<?php echo ($val["admin_name"]); ?></strong>
				<div><?php echo ($val["content"]); ?></div>
				<br/>
			</div><?php endforeach; endif; ?>
	</div>
 </div>
<div class="form-item">
	<?php if($user['is_auth'] == false): ?><button class="btn submit-btn" id="submit" type="submit" onclick="auth_conforms(1);">认 证</button>
	<?php else: ?>	
		<button class="btn submit-btn" id="submit" type="submit" onclick="auth_conforms(2);">取消认证</button><?php endif; ?>
	<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
</div>

<script type="text/javascript">

function auth_conforms(type)
{
	ajaxRequest("<?php echo U('AppUser/conformsAuth');?>", {"type":type,"id":$id,"note":$("#note").val()}, {"func":function(data){
		if(data) {
			if(data.error == 0) {
				alertDialog(data.info, 'alert-success', 3000);
				$("#conforms_auth").click();
			} else {
				alertDialog(data.info, 'alert-error', 3000);
			}
		} else {
			alertDialog('合格认证信息查询失败', 'alert-error', 3000);
		}
	}});	
}
</script>